<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
    <th:block th:include="include :: header('立项申请新增')"/>
</head>
<body class="pear-container" onload="scrollToView()">



<form class="layui-form" action=""  th:object="${ApplyProject}" readonly="true">

	<h4 align="center" style="font-size: large">项目基本信息</h4><br>
<div class="layui-card">
	<div class="layui-card-body">

							<div class="layui-form-item layui-hide">
								<label class="layui-form-label">id</label>
								<div class="layui-input-block">
									<input readonly  id="proId" type="text" th:value="*{id}" name="id" lay-verify="title"
										   autocomplete="off" class="layui-input">
								</div>
							</div>

							<div class="layui-form-item">
			                    <label class="layui-form-label" id="proNumberLabel">项目编号</label>
			                    <div class="layui-input-inline" id="proNumber">
			                        <input readonly  th:value="*{proNumber}" type="text" name="proNumber" autocomplete="off" placeholder="项目编号" class="layui-input">
			                    </div>

								<label class="layui-form-label">项目类型</label>
								<div class="layui-input-inline">
<!--									<input readonly  th:value="*{proType}" type="text" name="proType" autocomplete="off" placeholder="项目类型" class="layui-input">-->
										<select name="proType" id="proType" lay-filter="proType" th:field="*{proType}">
											<option value="a">新型智库项目</option>
											<option value="b">省级社科规划项</option>
										</select>
								</div>

								<label class="layui-form-label">学科分类</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{proSubject}" type="text" name="proSubject" autocomplete="off" placeholder="学科分类" class="layui-input">
								</div>

			                </div>

							<div class="layui-form-item">
								<label class="layui-form-label">项目名称</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{proName}" type="text" name="proName" autocomplete="off" placeholder="项目名称" class="layui-input">
								</div>

			                    <label class="layui-form-label">申报单位</label>
			                    <div class="layui-input-inline">
			                        <input readonly  th:value="*{proDept}" autocomplete="off" placeholder="申报单位" class="layui-input">
			                    </div>
			                </div>


</div>
</div>

<h4 align="center" style="font-size: large">课题负责人基本信息</h4><br>
<div class="layui-card">
	<div class="layui-card-body">





							<div class="layui-form-item">
			                    <label class="layui-form-label">姓名</label>
			                    <div class="layui-input-inline">
			                        <input readonly  th:value="*{manName}" type="text" name="manName" autocomplete="off" placeholder="负责人名称" class="layui-input">
			                    </div>

								<label class="layui-form-label">年龄</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{manAge}" type="text" name="manAge" autocomplete="off" placeholder="年龄" class="layui-input">

								</div>

								<label class="layui-form-label">性别</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{manSex}" type="text" name="manSex" autocomplete="off" placeholder="性别" class="layui-input">
								</div>

								<label class="layui-form-label">民族</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{manNation}" type="text" name="manNation" autocomplete="off" placeholder="民族" class="layui-input">
								</div>

			                </div>
									

									
											
							<div class="layui-form-item">
			                    <label class="layui-form-label">职务</label>
			                    <div class="layui-input-inline">
			                        <input readonly  th:value="*{manOffice}" type="text" name="manOffice" autocomplete="off" placeholder="职务" class="layui-input">
			                    </div>

								<label class="layui-form-label">专业职称</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{manTitle}" type="text" name="manTitle" autocomplete="off" placeholder="职称" class="layui-input">
								</div>

								<label class="layui-form-label">研究专长</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{manExpertise}" type="text" name="manExpertise" autocomplete="off" placeholder="专长" class="layui-input">
								</div>

								<label class="layui-form-label">电话</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{manPhone}" type="text" name="manPhone" autocomplete="off" placeholder="电话" class="layui-input">
								</div>

			                </div>

							<div class="layui-form-item">
			                    <label class="layui-form-label">通讯地址</label>
			                    <div class="layui-input-inline">
			                        <input readonly  th:value="*{manAddress}" style="width: 300px" type="text" name="manAddress" autocomplete="off" placeholder="地址" class="layui-input">
			                    </div>

								<label class="layui-form-label" style="margin-left: 80px">邮政编码</label>
								<div class="layui-input-inline" >
									<input readonly   th:value="*{manZip}" type="text" name="manZip" autocomplete="off" placeholder="邮政编码" class="layui-input">
								</div>

			                </div>

	</div>
</div>

<h4 align="center" style="font-size: large">与本课题有关的近期研究成果  <i id="ktTips" class="layui-icon layui-icon-tips" style="font-size: large"></i></h4>
<div class="layui-card">
	<div class="layui-card-body">
							<div class="layui-form-item">
			                    <label class="layui-form-label"></label>
			                    <div class="layui-input-block">
									<input readonly  th:value="*{proResearch}" type="text" name="proResearch" autocomplete="off" placeholder="近期研究成果" class="layui-input">
			                    </div>
			                </div>
	</div>
</div>

<h4 align="center" style="font-size: large">课题主要参与者基本情况</h4><br>
<div class="layui-card">
	<div class="layui-card-body">

							<div class="layui-form-item layui-hide">
			                    <label class="layui-form-label">主要参与者id</label>
			                    <div class="layui-input-block">
			                        <input readonly  type="text" name="partId" autocomplete="off" placeholder="主要参与者id" class="layui-input">
			                    </div>
			                </div>

							<table id="applyParticipator-table" lay-filter="applyParticipator-table"></table>

	</div>
</div>

<h4 align="center" style="font-size: large">课题论证设计  <i id="lzTips" class="layui-icon layui-icon-tips" style="font-size: large"></i></h4>
<div class="layui-card">
	<div class="layui-card-body">
							<div class="layui-form-item">
			                    <label class="layui-form-label"></label>
			                    <div class="layui-input-block">
									<input readonly  th:value="*{proDesign}" type="text" name="proDesign" autocomplete="off" placeholder="课题论证设计" class="layui-input">
			                    </div>
			                </div>
	</div>
</div>


<h4 align="center" style="font-size: large">完成本课题的条件分析  <i id="tjTips" class="layui-icon layui-icon-tips" style="font-size: large"></i></h4>
<div class="layui-card">
	<div class="layui-card-body">


							<div class="layui-form-item">
			                    <label class="layui-form-label"></label>
			                    <div class="layui-input-block">
			                        <input readonly  type="text" name="proAnalyse" autocomplete="off" placeholder="完成条件分析" class="layui-input">
			                    </div>
			                </div>

	</div>
</div>

<h4 align="center" style="font-size: large">参加者分工情况</h4><br>
<div class="layui-card">
	<div class="layui-card-body">

							<div class="layui-form-item layui-hide">
			                    <label class="layui-form-label">分工情况id</label>
			                    <div class="layui-input-block">
			                        <input readonly  type="text" name="taskId" autocomplete="off" placeholder="分工情况id" class="layui-input">
			                    </div>
							</div>

							<table id="applyTask-table" lay-filter="applyTask-table"></table>


	</div>
</div>

<h4 align="center" style="font-size: large">经费预算</h4><br>
<div class="layui-card">
	<div class="layui-card-body">

							<div class="layui-form-item">
			                    <label class="layui-form-label">资料费(元)</label>
			                    <div class="layui-input-inline">
			                        <input readonly  th:value="*{costMart}" type="text" name="costMart" autocomplete="off" placeholder="资料费" class="layui-input">
			                    </div>

								<label class="layui-form-label">差旅费(元)</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{costTraval}" type="text" name="costTraval" autocomplete="off" placeholder="差旅费" class="layui-input">
								</div>

								<label class="layui-form-label">会议费(元)</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{costConf}" type="text" name="costConf" autocomplete="off" placeholder="会议费" class="layui-input">
								</div>

								<label class="layui-form-label">设备费(元)</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{costDevice}" type="text" name="costDevice" autocomplete="off" placeholder="设备费" class="layui-input">
								</div>

							</div>

											
							<div class="layui-form-item">
			                    <label class="layui-form-label">打印费(元)</label>
			                    <div class="layui-input-inline">
			                        <input readonly  th:value="*{costPrint}" type="text" name="costPrint" autocomplete="off" placeholder="打印费" class="layui-input">
			                    </div>

								<label class="layui-form-label">咨询费(元)</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{costConsult}" type="text" name="costConsult" autocomplete="off" placeholder="咨询费" class="layui-input">
								</div>

								<label class="layui-form-label">其他经费(元)</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{costOther}" type="text" name="costOther" autocomplete="off" placeholder="其他经费" class="layui-input">
								</div>

								<label class="layui-form-label">总费用(元)</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{costTotal}" type="text" name="costTotal" autocomplete="off" placeholder="预计总费用" class="layui-input">
								</div>

			                </div>

											
							<div class="layui-form-item">
			                    <label class="layui-form-label">单位账号</label>
			                    <div class="layui-input-inline">
			                        <input readonly  th:value="*{costAccount}" style="width: 300px" type="text" name="costAccount" autocomplete="off" placeholder="经费单位账号" class="layui-input">
			                    </div>

								<label class="layui-form-label" style="margin-left: 80px">单位地址</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{costAddress}" style="width: 300px" type="text" name="costAddress" autocomplete="off" placeholder="经费单位地址" class="layui-input">
								</div>

								<label class="layui-form-label" style="margin-left: 80px">单位邮编</label>
								<div class="layui-input-inline">
									<input readonly  th:value="*{costZip}" type="text" name="costZip" autocomplete="off" placeholder="经费单位邮政编码" class="layui-input">
								</div>
			                </div>

							<div class="layui-form-item">
								<label class="layui-form-label">备注</label>
								<div class="layui-input-block">
									<input readonly  th:value="*{costRemark}" type="text" name="costRemark" autocomplete="off" placeholder="备注" class="layui-input">
								</div>
							</div>

							<div class="layui-form-item layui-hide">
								<label class="layui-form-label">锚点</label>
								<div class="layui-input-block">
									<input readonly  id="proAnchor" th:value="*{proAnchor}" type="text" name="proAnchor" autocomplete="off" class="layui-input">
								</div>
							</div>
	</div>
</div>

	<h4 align="center" style="font-size: large">课题负责人所在单位审核意见</h4><br>
	<h4 align="center" style="font-size: medium">(1、申请书所填写的内容是否属实；2、申请者的政治素质与业务水平是否适于承担本课题的研究)</h4>
	<h4 align="center" style="font-size: medium">(3、主管单位能否提供完成本课题所需时间和其他必要条件；4、本单位是否同意承担本课题的经费管理和信誉保证)</h4><br>
	<div class="layui-card">
		<div class="layui-card-body">
			<div class="layui-form-item">
				<div class="layui-input-block">
					<input type="text" name="deptRemark" autocomplete="off"  class="layui-input">
				</div>
			</div><br><br><br>
</div>
</div>
	<div class="bottom" style="position: fixed;bottom: 0">
		<div class="button-container">
<!--			<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id="expect" lay-event="expect" lay-filter="expect">-->
<!--				<i class="layui-icon layui-icon-ok"></i>-->
<!--				专家审核-->
<!--			</button>-->
<!--			<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="applyProject-noPass">-->
<!--				<i class="layui-icon layui-icon-close"></i>-->
<!--				审核不通过-->
<!--			</button>-->
			<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id="audit" lay-event="audit" lay-filter="audit">
				<i class="layui-icon layui-icon-ok"></i>
				鉴定评分
			</button>
<!--			<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">-->
<!--				<i class="layui-icon layui-icon-refresh"></i>-->
<!--				重置-->
<!--			</button>-->
		</div>
	</div>

</form>
<script>
	//打开窗口运行锚点定位
	function scrollToView(){
		var distance =  $("#proAnchor").val()
		$("body,html").scrollTop(distance);  //兼容滚动写法
	}
	//获取锚点最终位置
	function scrollToEnd(){
		var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
		return scrollY;
	}
</script>

<th:block th:include="include :: footer"/>
<script>
    layui.use(['form','laydate','jquery','table'], function () {
		let table = layui.table;
        let form = layui.form;
        let $ = layui.jquery;
        let MODULE_PATH = rootPath+"/AuditApplySKLController";


		//完成本课题条件论证提示
		$("#tjTips").mouseover(function() {
			layer.tips('包括参加人员的研究能力、资料设备、科研手段和时间保证等', this, {
				tips: [3, "#170c0c"],time:6000,
			});
		});

		//课题论证提示
		$("#lzTips").mouseover(function() {
			layer.tips('1.本课题国内外或省内外研究概况，本课题研究的理论意义。</br>' +
					'2.本课题研究的主要观点、主要内容、篇章结构、重点和难点分析。</br>' +
					'3.本课题的研究方法，预期研究成果。逐项填写，篇幅不够可加另项', this, {
				tips: [3, "#170c0c"],time:6000,
			});
		});

		//课题有关近期研究成果提示
		$("#ktTips").mouseover(function() {
			layer.tips('近期研究成果应注明成果名称、成果形式、发表刊物或出版单位，发表或出版时间', this, {
				tips: [3, "#170c0c"],time:6000,
			});
		});


		//绑定鉴定评分按钮
		$("#audit").click(function (data){
			var proId = $("#proId").val();
			// console.log(data);
			data.id = proId;
			layer.open({
				type: 2,
				title: '新增',
				area: ['1305px', '651px'],
				content: rootPath+"/ApplyScoreController" + '/applyScore/' + data.id,
				success: function(layero, index) {
					var body = layer.getChildFrame('body', index);//建立父子联系【核心语句】
					var iframeWin = window[layero.find('iframe')[0]['name']];//【核心句】
					// iframeWin.method();   //这句话的意思是可以通过ifarmeWin调用子页面的方法
					var inputList = body.find('input');     //取得子页面中input输入框
					//将父页项目ID传给子页面
					body.find(inputList[0]).val(proId);
				}
			});
		});

		// $("#expect").click(function() {
		// 	var proId = $("#proId").val();
		// 		layer.open({
		// 			type: 2,
		// 			title: '新增',
		// 			area: ['1305px', '651px'],
		// 			content: rootPath+"/ExpertController/" + 'selectApply',
		// 			success: function(layero, index){
		// 				var body = layer.getChildFrame('body',index);//建立父子联系【核心语句】
		// 				var iframeWin = window[layero.find('iframe')[0]['name']];//【核心句】
		// 				// console.log(body);
		// 				// iframeWin.method();   //这句话的意思是可以通过ifarmeWin调用子页面的方法
		// 				var inputList = body.find('input');     //取得子页面中input输入框
		// 				//将父页项目ID传给子页面
		// 				body.find(inputList[1]).val(proId);
		// 			}
		// 		});
		// });

		//table字段
		let cols = [
			[
				{type: 'checkbox'},
				{title: '序号', type: 'numbers'},
				{title: '姓名', field: 'partName', align: 'center'},

				{title: '年龄', field: 'partAge', align: 'center'},

				{title: '专业职称', field: 'partTitle', align: 'center'},

				{title: '工作单位', field: 'partDept', align: 'center'},

				{title: '研究专长', field: 'partExpertise', align: 'center'},

				{title: '负责人', field: 'manName', align: 'center'},

				{title: '近期研究成果', field: 'researchRes', align: 'center'},
			]
		]

		//参与者基本信息table表单列表
		table.render({
			elem: '#applyParticipator-table',
			url: rootPath+"/AuditApplyExpertController/" + 'list',      //此处跳转到ApplyParticipatorController
			page: true,
			method: 'get',
			cols: cols,
			skin: 'line',
		});

		//分工情况table字段
		let cols2 = [
			[
				{type: 'checkbox'},

				{title: '序号', type: 'numbers'},

				{title: '承担人', field: 'partName', align: 'center'},

				{title: '研究开始时间', field: 'dateStart', align: 'center'},

				{title: '最终完成时间', field: 'dateEnd', align: 'center'},

				{title: '阶段成果名称', field: 'resName', align: 'center'},

				{title: '最终成果形式', field: 'resType', align: 'center'},
			]
		]

		//分工情况table表单列表
		table.render({
			elem: '#applyTask-table',
			url: rootPath+"/ApplyTaskController/" + 'list',
			page: true,
			method: 'get',
			cols: cols2,
			skin: 'line',
		});

		//专家审核
		// form.on('submit(applyProject-expect)', function (data) {
		// 	let loader = layer.load();
		// 	//单位审核通过
		// 	data.field.deptPass = 1;
		// 	//社科联审核状态为待审核
		// 	data.field.sklPass = 0;
		// 	$.ajax({
		// 		url: MODULE_PATH+'/edit',
		// 		data: data.field,
		// 		dataType: 'json',
		// 		contentType: 'application/x-www-form-urlencoded',
		// 		type: 'post',
		// 		success: function (result) {
		// 			if (result.code==200) {
		// 				layer.msg(result.msg, {icon: 1, time: 1000}, function () {
		// 					parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
		// 					parent.layui.table.reload("applyProject-table");
		// 					layer.close(loader);
		// 				});
		// 			} else {
		// 				layer.msg(result.msg, {icon: 2, time: 1000});
		// 				layer.close(loader);
		// 			}
		// 		}
		// 	})
		// 	return false;
		// });



        //审核不通过
		form.on('submit(applyProject-noPass)', function (data) {
			let loader = layer.load();
			//单位审核不通过
			data.field.deptPass = 2;
			//项目状态为审核不通过
			data.field.proState = 2;
			$.ajax({
				url: MODULE_PATH+'/edit',
				data: data.field,
				dataType: 'json',
				contentType: 'application/x-www-form-urlencoded',
				type: 'post',
				success: function (result) {
					if (result.code==200) {
						layer.msg(result.msg, {icon: 1, time: 1000}, function () {
							parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
							parent.layui.table.reload("applyProject-table");
							layer.close(loader);
						});
					} else {
						layer.msg(result.msg, {icon: 2, time: 1000});
						layer.close(loader);
					}
				}
			})
			return false;
		});
    })
</script>
</body>
</html>